- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.6k
[v22.x backport] http2: fix allowHttp1+Upgrade, broken by shouldUpgradeCallback #60341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
    
      
        
          +150
        
        
          −0
        
        
          
        
      
    
  
Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    This is required to use HTTP/1 websockets on an HTTP/2 server, which is fairly common as websockets over HTTP/2 is much less widely supported. This was broken by the recent shouldUpgradeCallback HTTP/1 addition, which wasn't correctly added to the corresponding allowHttp1 part of the HTTP/2 implementation. PR-URL: nodejs#59924 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
| Review requested: 
 | 
              
                    marco-ippolito
  
              
              approved these changes
              
                  
                    Oct 22, 2025 
                  
              
              
            
            
| Actually this points to v22, perhaps the title is wrong? | 
| @marco-ippolito yes, you're totally right, now fixed - this is indeed for v22. | 
              
                    richardlau
  
              
              approved these changes
              
                  
                    Oct 22, 2025 
                  
              
              
            
            
    
  aduh95 
      pushed a commit
      that referenced
      this pull request
    
      Oct 22, 2025 
    
    
      
  
    
      
    
  
This is required to use HTTP/1 websockets on an HTTP/2 server, which is fairly common as websockets over HTTP/2 is much less widely supported. This was broken by the recent shouldUpgradeCallback HTTP/1 addition, which wasn't correctly added to the corresponding allowHttp1 part of the HTTP/2 implementation. PR-URL: #59924 Backport-PR-URL: #60341 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
              
                    trivikr
  
              
              approved these changes
              
                  
                    Oct 23, 2025 
                  
              
              
            
            
| Landed in 23468fd | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Backport for #59924.
This also backports the corresponding full code for the websocket test server into the tests. That was introduced in #59404 (which is marked dont-land-on-v22) but it's required for the tests for this change.